import 'package:flutter/material.dart';

class FlexPageWithSafeArea extends StatefulWidget {
  const FlexPageWithSafeArea({super.key});

  @override
  State<FlexPageWithSafeArea> createState() => _FlexPageWithSafeAreaState();
}

class _FlexPageWithSafeAreaState extends State<FlexPageWithSafeArea> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Flex(
        direction: Axis.vertical,
        children: [
          Expanded(
            flex: 1,
            child: Container(color: Colors.blueAccent),
          ),
          Expanded(
            flex: 1,
            child: Container(color: Colors.yellowAccent),
          ),
        ],
      ),
    );
  }
}
